//package sundun.sharding.config;
//
//import org.springframework.beans.factory.InitializingBean;
//import org.springframework.stereotype.Component;
//import sundun.sharding.table.ShardingTableProvider;
//
//import javax.annotation.Resource;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//@Component
//public class ShardingTablesFactory implements InitializingBean {
//
//
//    @Resource
//    private List<ShardingTableProvider> list;
//
//    public static Map<String,ShardingTableProvider> map = new HashMap<>();
//    @Override
//    public void afterPropertiesSet() throws Exception {
//        for (ShardingTableProvider shardingTableProvider : list) {
//            map.put(shardingTableProvider.getLogicTableName(),shardingTableProvider);
//        }
//    }
//
//    public static List<ShardingTableProvider> getAllShardingTable(){
//        return (List<ShardingTableProvider>) map.values();
//    }
//
//    public static ShardingTableProvider of(String tableName){
//        return map.get(tableName);
//    }
//
//
//}
